﻿using System;
using Microsoft.MediaPlayer.Interop;

namespace BMproductions.Media.MediaPlayer.WMPPlus {
	public abstract class WMPPlusModule: IDisposable, IWMPEvents {
		public WMPPlusPublic Owner { get; private set; }

		public WMPPlusModule(WMPPlusPublic owner) : this(owner, true) { }
		protected WMPPlusModule(WMPPlusPublic owner, bool prepare) {
			Owner = owner;
			if (prepare)
				Init();
		}

		protected abstract void Init();
		public virtual void Dispose() {}

		#region IWMPEvents implementation
		public virtual void AudioLanguageChange(int LangID) { }

		public virtual void Buffering(bool Start) { }

		public virtual void CdromMediaChange(int CdromNum) { }

		public virtual void Click(short nButton, short nShiftState, int fX, int fY) { }

		public virtual void CurrentItemChange(object pdispMedia) { }

		public virtual void CurrentMediaItemAvailable(string bstrItemName) { }

		public virtual void CurrentPlaylistChange(WMPPlaylistChangeEventType change) { }

		public virtual void CurrentPlaylistItemAvailable(string bstrItemName) { }

		public virtual void Disconnect(int Result) { }

		public virtual void DomainChange(string strDomain) { }

		public virtual void DoubleClick(short nButton, short nShiftState, int fX, int fY) { }

		public virtual void DurationUnitChange(int NewDurationUnit) { }

		public virtual void EndOfStream(int Result) { }

		public virtual void Error() { }

		public virtual void KeyDown(short nKeyCode, short nShiftState) { }

		public virtual void KeyPress(short nKeyAscii) { }

		public virtual void KeyUp(short nKeyCode, short nShiftState) { }

		public virtual void MarkerHit(int MarkerNum) { }

		public virtual void MediaChange(object Item) { }

		public virtual void MediaCollectionAttributeStringAdded(string bstrAttribName, string bstrAttribVal) { }

		public virtual void MediaCollectionAttributeStringChanged(string bstrAttribName, string bstrOldAttribVal, string bstrNewAttribVal) { }

		public virtual void MediaCollectionAttributeStringRemoved(string bstrAttribName, string bstrAttribVal) { }

		public virtual void MediaCollectionChange() { }

		public virtual void MediaError(object pMediaObject) { }

		public virtual void ModeChange(string ModeName, bool NewValue) { }

		public virtual void MouseDown(short nButton, short nShiftState, int fX, int fY) { }

		public virtual void MouseMove(short nButton, short nShiftState, int fX, int fY) { }

		public virtual void MouseUp(short nButton, short nShiftState, int fX, int fY) { }

		public virtual void NewStream() { }

		public virtual void OpenPlaylistSwitch(object pItem) { }

		public virtual void OpenStateChange(int NewState) { }

		public virtual void PlayStateChange(int NewState) { }

		public virtual void PlayerDockedStateChange() { }

		public virtual void PlayerReconnect() { }

		public virtual void PlaylistChange(object Playlist, WMPPlaylistChangeEventType change) { }

		public virtual void PlaylistCollectionChange() { }

		public virtual void PlaylistCollectionPlaylistAdded(string bstrPlaylistName) { }

		public virtual void PlaylistCollectionPlaylistRemoved(string bstrPlaylistName) { }

		public virtual void PlaylistCollectionPlaylistSetAsDeleted(string bstrPlaylistName, bool varfIsDeleted) { }

		public virtual void PositionChange(double oldPosition, double newPosition) { }

		public virtual void ScriptCommand(string scType, string Param) { }

		public virtual void StatusChange() { }

		public virtual void SwitchedToControl() { }

		public virtual void SwitchedToPlayerApplication() { }

		public virtual void Warning(int WarningType, int Param, string Description) { }
		#endregion
	}
}
